<%-- 
    Document   : timer
    Created on : 10 Feb, 2015, 4:17:53 AM
    Author     : unnati
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
       <form name="counter"><input type="text" size="8" 
name="d2"></form> 

<script> 
<!-- 
// 
 var milisec=0 
 var seconds=30
 var minute=12
 document.counter.d2.value='12' 

function display(){ 
 if (milisec<=0){ 
    milisec=9 
    seconds-=1 
 } 
 if (seconds<=-1){ 
    milisec=0 
    seconds+=1
    minute-=1
 } 
 if(minute<=-1)
 {
     milisec=0
     second=0
     minute+=1
 }
 else 
    milisec-=1 
    document.counter.d2.value=minute+"."+seconds+"."+milisec 
    setTimeout("display()",100) 
} 
display() 
--> 
</script> 

    </body>
</html>
